﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="common.aspx.cs" Inherits="Js_各种效果集合Demo_common" ValidateRequest="false" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <script type="text/javascript" src="../jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="../common/common.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    onclick="checkAll(this.id,'div1')"<br />
    <input type="text" id="myResult" />
    <script type="text/javascript">
        $(function(){
            $("#div1 input[type='checkbox']").click(function(){
                var data="";
                $("#div1 input[type='checkbox']").not("#Checkbox1").each(function(i){
                    if($(this).attr('checked')==true){
                        data +=$(this).val()+",";
                    }
                });
                $("#myResult").val(data);
            });
        });
    </script>
<div id="div1">
<table>
<tr>
    <td><input id="Checkbox1" type="checkbox" value="0" onclick="checkAll(this.id,'div1')"/></td>
    <td>全选/取消</td>
</tr>
<tr>
    <td><input id="Checkbox2" type="checkbox" value="1"/></td>
    <td>1</td>
</tr>
<tr>
    <td><input id="Checkbox3" type="checkbox" value="2" /></td>
    <td>2</td>
</tr>
<tr>
    <td><input id="Checkbox4" type="checkbox" value="3" /></td>
    <td>3</td>
</tr>
<tr>
    <td><input id="Checkbox5" type="checkbox" value="4" /></td>
    <td>4</td>
</tr>
</table>
</div>
onclick="checkAllByName(this.id,'c')"
<div id="div3">
<table>
<tr>
    <td><input id="Checkbox11" type="checkbox" onclick="checkAllByName(this.id,'c')"/></td>
    <td>全选/取消</td>
</tr>
<tr>
    <td><input id="Checkbox12" type="checkbox" name="c" /></td>
    <td>1</td>
</tr>
<tr>
    <td><input id="Checkbox13" type="checkbox" name="c" /></td>
    <td>2</td>
</tr>
<tr>
    <td><input id="Checkbox14" type="checkbox" name="c" /></td>
    <td>3</td>
</tr>
<tr>
    <td><input id="Checkbox15" type="checkbox" name="c" /></td>
    <td>4</td>
</tr>
</table>
</div>
<hr />
onclick="checkChange('div2')"
<div id="div2">
<table>
<tr>
    <td><input id="Checkbox6" type="checkbox" onclick="checkChange('div2')"/></td>
    <td>反选</td>
</tr>
<tr>
    <td><input id="Checkbox7" type="checkbox" /></td>
    <td>1</td>
</tr>
<tr>
    <td><input id="Checkbox8" type="checkbox" /></td>
    <td>2</td>
</tr>
<tr>
    <td><input id="Checkbox9" type="checkbox" /></td>
    <td>3</td>
</tr>
<tr>
    <td><input id="Checkbox10" type="checkbox" /></td>
    <td>4</td>
</tr>
</table>
</div>
onclick="checkChangeByName('ck')"
<div id="div4">
<table>
<tr>
    <td><input id="Checkbox16" type="checkbox" onclick="checkChangeByName('ck')"/></td>
    <td>反选</td>
</tr>
<tr>
    <td><input id="Checkbox17" type="checkbox" name="ck" /></td>
    <td>1</td>
</tr>
<tr>
    <td><input id="Checkbox18" type="checkbox" name="ck" /></td>
    <td>2</td>
</tr>
<tr>
    <td><input id="Checkbox19" type="checkbox" name="ck" /></td>
    <td>3</td>
</tr>
<tr>
    <td><input id="Checkbox20" type="checkbox" name="ck" /></td>
    <td>4</td>
</tr>
</table>
</div>
<span>格式化字符:$.format("今天天气很{0},小明{1}了"</span>，"<input id="Text1" type="text" value="好" />"，"<input id="Text2"
    type="text" value="笑" />")
    <input id="Button1" type="button" value="doFormat" onclick="doFormat()" />
    <hr />
    <span id="formatString"></span>
    <script type="text/javascript">
        function doFormat(){
            var myString = $.format("今天天气很{0},小明{1}了",$('#Text1').val(),$('#Text2').val());
            $('#formatString').text(myString);
        }
    </script>
    <hr />
        <input id="Text3" type="text" value="&lt;script&gt;alert(1);&lt;/script&gt;" style="width:300px;" onclick="this.select()" />
       
        <asp:Button ID="Button3" runat="server" Text="过滤" OnClientClick="sub()" OnClick="Button3_Click" />
        <asp:Button ID="Button2" runat="server" Text="一般提交" OnClick="Button2_Click" />
        <hr />
        <hr />
        <asp:Literal ID="Literal1" runat="server" EnableViewState="true"></asp:Literal>
        <br />
        <asp:TextBox ID="txtEmail" Text="xixidd@vip.qq.com" runat="server"></asp:TextBox><br />
        <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="email验证" /></div>
    </form>
</body>
</html>
